<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:cc="http://java.sun.com/jsf/composite"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <!-- INTERFACE -->
    <cc:interface>
    </cc:interface>

    <!-- IMPLEMENTATION -->
    <cc:implementation>
        <span id="#{cc.clientId}">
            <p:dialog header="Cadastrar Backlog" widgetVar="dlgBacklog" draggable="true" modal="true">
                <p:outputPanel id="outputPanelBacklog">
                    <h:form id="formCadBacklog">
                        <p:defaultCommand target="salvar"/>
                        <p:messages id="msgCad"/>
                        <h:panelGrid>
                            <h:outputText value="Produto: *" style="font-weight: bold;margin-right: 20px;"/>
                            <p:selectOneMenu required="true" requiredMessage="Selecione um Produto" value="#{backlogController.backlog.produto}" converter="entityConverter" style="width:380px;">                            
                                <f:selectItem itemValue="" itemLabel=""/>
                                <f:selectItems value="#{backlogController.produtos}" 
                                               var="produto"
                                               itemLabel="#{produto.nome}"
                                               itemValue="#{produto}"/>
                            </p:selectOneMenu>
                            <h:outputText value="Descrição: *" style="font-weight: bold;margin-right: 20px;"/>
                            <p:inputTextarea required="true" requiredMessage="O campo Descrição é obrigatório" value="#{backlogController.backlog.descricao}" cols="50" />
                            <h:outputText value="Como demonstrar:" style="font-weight: bold;margin-right: 20px;"/>
                            <p:inputTextarea value="#{backlogController.backlog.comoDemonstrar}" cols="50" />
                            <h:outputText value="Notas:" style="font-weight: bold;margin-right: 20px;"/>
                            <p:inputText value="#{backlogController.backlog.notas}" size="50" />
                            <h:outputText value="Importância:" style="font-weight: bold;margin-right: 20px;"/>
                            <p:inputMask mask="9?999" value="#{backlogController.backlog.importancia}" size="10" />
                            <h:outputText value="Estimativa:" style="font-weight: bold;margin-right: 20px;"/>
                            <p:inputMask mask="9?999" value="#{backlogController.backlog.estimativa}" size="10" />
                            <p:separator style="margin:10px 0;"/>
                            <h:panelGrid columns="2" style="float: right">
                                <p:commandButton value="Salvar" id="salvar" action="#{backlogController.salvar()}" update=":formBacklog:msgInicial, :#{cc.clientId}:outputPanelBacklog, :formBacklog:dataTableBacklog"/>
                                <p:commandButton value="Fechar" onclick="dlgBacklog.hide();" type="button"/>
                            </h:panelGrid>
                        </h:panelGrid>
                    </h:form>
                </p:outputPanel>
            </p:dialog>
        </span>
    </cc:implementation>
</html>